{extend name='common/base'/}
{block name='css'}
<link rel="stylesheet" href="/static/frontend/css/home.min.css?v=0.0.1">
<link rel="stylesheet" href="/static/frontend/plugin/clock/jquery.flipcountdown.css?v=0.0.1">
{/block}
{block name='content'}
<main class="main m-b-15 container clearfix">
    <!-- 轮播 -->
    <div class="main-top m-b-15 d-flex">
        <div class="main-top-left">
            <div class="layui-carousel" id="layui-carousel">
                <div carousel-item>
                    {foreach $carousel_list as $v}
                    <div class="main-top-left-img-box">
                        <img src="{$v['img_path']}" alt="">
                    </div>
                    {/foreach}
                </div>
            </div>
        </div>
        <div class="main-top-right">
            <!-- 小工具 -->
            <div class="main-top-right-top bg-white m-b-5">
                <img src="/static/frontend/img/development.png" alt="">
            </div>
            <div class="main-top-right-center bg-white m-b-5">
                {if !empty($tools)}
                <ul class="main-top-right-center-tools d-flex">
                    {foreach $tools as $k=>$v}
                    <li class="d-flex">
                        <a class="d-flex" href="{$v.link}" target="_blank" title="{$v.title}">
                            <img src="{$v.icon}"
                                 alt="{$v.title}">
                            <p>{$v.title}</p>
                        </a>
                    </li>
                    {/foreach}
                </ul>
                {else/}
                <div class="empty d-flex">
                    <span class="icon icon-empty d-block"></span>
                    <em>正在努力研发中...</em>
                </div>
                {/if}
            </div>
            <div class="main-top-right-end d-flex" id="time">

            </div>
        </div>
    </div>
    <!-- 通知 -->
    <div class="main-tool-bar container bg-white m-b-15 d-flex">
        <div class="main-tool-bar-announcement">
            <div class="main-tool-bar-announcement-text">
                <img src="/static/frontend/img/announcement.gif" alt="">{$web_notice}
            </div>
        </div>
        <div class="main-tool-bar-weather d-flex">
            <div id="tp-weather-widget"></div>
            <div class="mask"></div>
        </div>
        <div class="main-tool-bar-statistics d-flex">
            <div class="text-default m-l-10 main-tool-bar-statistics-text">站内统计：</div>
            <ul class="main-tool-bar-statistics-ul d-flex">
                {foreach $count_data as $k=>$v}
                <li class="text-default  p-l-5 p-r-5"><span class="text-orange p-r-5">{$v.count}</span>{$v.title}</li>
                {/foreach}
            </ul>
        </div>
    </div>
    <!-- 文章 -->
    <div class="main-article container d-flex m-b-15">
        <div class="main-article-left">
            {if $article_list->isEmpty()}
            <div class="main-article-box bg-white m-b-10">
                <div class="empty d-flex">
                    <span class="icon icon-empty d-block"></span>
                    <em>不会写文章，怎么办...</em>
                </div>
            </div>
            {else/}
            {foreach $article_list as $k=>$v}
                <div class="main-article-box d-flex bg-white m-b-10">
                <a href="{:url('article_read',['id'=>str_pad($v['id'],15,'0',STR_PAD_LEFT)])}"
                   class="main-article-box-img  d-block left">
                    <img class="" src="{$v.cover[0]??''}" onerror="this.src='/static/frontend/img/no_img.jpg'" alt="">
                </a>
                <div class="main-article-box-text m-t-5 m-b-5">
                    <a href="{:url('article_read',['id'=>str_pad($v['id'],15,'0',STR_PAD_LEFT)])}">
                        <h3>{$v.title}</h3>
                    </a>
                    <p class="">
                        {$v.description}
                    </p>
                    <div class="main-article-box-text-info ">
                        <div class="main-article-box-text-info-tag-list d-flex m-b-5">
                            {foreach $v.tag as $key=>$value}
                            <a href="{:url('search_index',['k'=>$value])}">#{$value}#</a>
                            {/foreach}
                        </div>
                        <div class="main-article-box-text-info-list d-flex">
                            <a href="javascript:;">
                                <i class="icon icon-auth"></i>
                                <span class="text-success">
                                        {$v.author?:'傲杰笔记'}
                                    </span>
                            </a>
                            <a href="javascript:;">
                                <i class="icon icon-time"></i>
                                <span class="text-warning">
                                      {$v.publish_time?:$v.create_time}
                                    </span>
                            </a>
                            <a href="javascript:;">
                                <i class="icon icon-like"></i>
                                <span class="text-blue">
                                        {$v.like}
                                    </span>
                            </a>
                            <a href="javascript:;">
                                <i class="icon icon-comment"></i>
                                <span class="text-orange">
                                        {$v.comments_count}
                                    </span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            {/foreach}
            {/if}
        </div>
        <div class="main-article-right">
            {include file='common/author'/ }
            {include file='common/tag_list'/ }
            {include file='common/ranking'/ }
        </div>

    </div>
    {include file='common/friend_link' }
</main>
{/block}
{block name='js'}
<script src="/static/frontend/js/index.js"></script>
{/block}
